/* eslint-disable @typescript-eslint/no-explicit-any */

import { defineComponent, KeepAlive } from 'vue'
import { RouterView, RouteRecordRaw } from 'vue-router'

export default defineComponent({
  setup() {
    return () => (
      <>
        <RouterView
          v-slots={{
            default: ({ Component = () => <div></div> }: { Component: any; route: RouteRecordRaw }) => {
              // Index 组件内部有缓存路由,因此它本身也需要缓存
              return (
                <KeepAlive include={['Home', 'Mine']}>
                  <Component />
                </KeepAlive>
              )
            },
          }}
        />
      </>
    )
  },
})
